import { get, post, put, deletefn } from './http.js'

/*定义了一个apiAddress方法，
这个方法有一个参数p，
p是我们请求接口时携带的参数对象。
而后调用了封装的post方法，
post方法的第一个参数接口地址，
第二个参数是apiAddress的p参数，即请求接口时携带的参数对象。最后通过export导出apiAddress。*/


// 获取用户的科室权限数据
export const getUserights = p2 => get('/api/services/app/User/GetUserDepName', p2);
//获取id
export const GetTenantId = p2 => post('/api/services/app/Account/IsTenantAvailable', p2);
//获取token​/api​/TokenAuth​/Authenticate
export const GetToken = p3 => post('/api/TokenAuth/Authenticate', p3, true);
// 添加暂存点id和名字
export const addStaging = p2 => post('/api/services/app/Med_Warehouse/Create', p2);
// 暂存点查询
export const getData = p2 => get('/api/services/app/Med_Warehouse/GetAll', p2);
// 修改暂存点数据
export const modifyData = p2 => put('/api/services/app/Med_Warehouse/Update', p2);
// 医废明细追踪
export const detailed = p2 => get('/api/services/app/Med_LittleInfo/GetList', p2);
// 医废明细追踪
export const detailedForm = p2 => get('/api/services/app/Med_LittleInfo/Get', p2);
// 饼状图数据
export const pieChartOne = p2 => get('/api/services/app/Med_LittleInfo/Get_PieChart', p2);
// 折线图数据detailed
export const getDiscount = p2 => get('/api/services/app/Med_LittleInfo/Get_Histogram', p2);
// 柱状图数据
export const getColumnData = p2 => get('/api/services/app/Med_LittleInfo/Get_ColumnarChart', p2);
// 获取没年月日的数据
export const getTimeData = p2 => get('/api/services/app/Med_LittleInfo/Get_Wg', p2);
// 获取角色管理数据
export const getRolesData = p2 => get('/api/services/app/Role/GetAll', p2);
// 搜索数据
export const getSearchData = p2 => get('/api/services/app/Med_LittleInfo/GetList', p2);
// 获取人员管理数据
export const getPersonData = p2 => get('/api/services/app/Med_Members/GetAll', p2);
// 查询人员管理数据
export const getPersonDataOne = p2 => get('/api/services/app/Med_Members/Get', p2);
// 添加人员管理数据
export const getPersonDataThings = p2 => post('/api/services/app/Med_Members/Create', p2);
// 获取用户管理数据
export const getRoleData = p2 => get('/api/services/app/User/GetAll', p2);
// 查询角色管理数据
export const getRoleDataOne = p2 => get('/api/services/app/User/GetCurrentUser', p2);
// 添加角色管理数据
// export const addRoleDataThings = p2 => post('/api/services/app/Role/Create', p2);
// 获取科室数据
export const getDepartmentData = p2 => get('/api/services/app/Med_Department/GetAll', p2);
// 添加科室数据
export const addDepartmentData = p2 => post('/api/services/app/Med_Department/Create', p2,);
// 获取单条科室数据
export const getDepartmentDataOne = p2 => get('/api/services/app/Med_Department/Get', p2);
// 修改科室数据
export const putDepartmentDataOneThings = p2 => put('/api/services/app/Med_Department/Update', p2);
// 获取转运数据
export const gettransportmentData = p2 => get('/api/services/app/Med_TransferCompany/GetAll', p2);
// 添加转运数据
export const addtransportmentData = p2 => post('/api/services/app/Med_TransferCompany/Create', p2,);
// // 获取单条转运数据
export const gettransportmentDataOne = p2 => get('/api/services/app/Med_TransferCompany/Get', p2);
// // 修改转运数据
export const puttransportmentData = p2 => put('/api/services/app/Med_TransferCompany/Update', p2);
// 科室管理搜索接口
export const getDepartment = p2 => get('/api/services/app/Med_Department/GetList', p2);
// 添加用户
export const addUserData = p2 => post('​/api/services/app/User/Create', p2,);
// 获取多选框数据
export const getChoiceData = p2 => get('/api/services/app/Med_Department/GetDepNames', p2);
// 修改医废明细数据
export const modifyDocData = p2 => put('/api/services/app/Med_TransferCompany/Update', p2);
// 获取医废报表的公司数据
export const companyStatementsData = p2 => get('/api/services/app/Med_TransferCompany/GetTransferNames', p2);
// 获取医废报表数据
export const getCompanyStatementsData = p2 => get('/api/services/app/Med_LittleInfo/GetFromData', p2);
// 导出医废报表表格
export const exportTable = p2 => get('/Home/ExportExcel', p2);
// 用户状态切换
export const modifyState = p2 => put('/api/services/app/User/UpdateActive', p2);
// 删除用户
export const deleteUser = p2 => deletefn('​​/api/services/app/User/Delete', p2);
// 用户管理编辑功能
export const modifyUserManagement = p2 => put('​/api/services/app/User/UpdateProxy', p2);
// 导出明细
export const exportTableOne = p2 => get('/Home/ExportDetailsExcel', p2);

